package com.heima.scan.applicationrunner;

import com.heima.scan.service.WmSensitiveService;
import com.heima.utils.common.SensitiveWordUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class NewsScanTextApplicationRunner implements ApplicationRunner {

    @Autowired
    private WmSensitiveService wsensitiveService;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        List<String> list = wsensitiveService.queryAll();
        SensitiveWordUtil.initMap(list);
    }
}
